package com.vchello.dao.security;

import java.util.List;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.vchello.bean.security.UserRole;
import com.vchello.bean.user.User;

/**
 * 
 * @author power
 *
 */
public interface UserRoleDao extends BaseMapper<UserRole>{

	UserRole findUserRole(int userId);
	
	boolean updateUserRole(UserRole userRole);
	
	Page<UserRole> findUserRoleByFatherId(Page<UserRole> page, User user, int roleId);
	
	int findUserRoleChildren(int userId);
	
	List<UserRole> findUsreRoleByFatherId(int fatherId);
	
	Page<UserRole> findUsreRoleByFatherId(Page<UserRole> page, int fatherId);
	
	void deleteUserRole(UserRole userRole);
	
	boolean saveUserRole(UserRole userRole);
	
	List<UserRole> findUserRoleByRoleId(int userId, int roleId);
}
